﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Program08
{
    class Program
    {
        static void Main(string[] args)
        {
            #region 老版本
            //var red = new RedHeadDuck();
            //red.DisplayName();

            //父类的调用
            //red.Fly("横着飞");
            //red.Quack("嘎嘎嘎");

            //接口的
            //red.Fly();
            //red.Quack();

            //自个整的
            //red.SetFly(new FlySide());
            //red.GetFly();
            #endregion

            //调用野鸭
            var md = new MallardDuck();
            Console.WriteLine(md.DisplayName() +""+ md.flyBehavior.Fly());

            Console.ReadLine();
        }
    }
}
